using System.Runtime.InteropServices;

namespace Communication
{
    /// <summary>
    /// Specifies the settings for new message notifications.
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public struct MessageIndicationSettings
    {
        private int _mode;
        private int _mt;
        private int _bm;
        private int _ds;
        private int _bfr;

        /// <summary>
        /// Initializes a new instance of the structure.
        /// </summary>
        /// <param name="mode">Specifies the general indication mode.</param>
        /// <param name="mt">Specifies how new SMS-DELIVER messages should be indicated.</param>
        /// <param name="bm">Specifies how new Cell Broadcast messages should be indicated.</param>
        /// <param name="ds">Specifies how new SMS-STATUS-REPORT messages should be indicated.</param>
        /// <param name="bfr">Specifies how the indication buffer should be handled when indications are activated, i.e.
        /// when MessageIndicationSettings.Mode is set to any value except MessageIndicationMode.DoNotForward.</param>
        public MessageIndicationSettings(int mode, int mt, int bm, int ds, int bfr)
        {
            _mode = mode;
            _mt = mt;
            _bm = bm;
            _ds = ds;
            _bfr = bfr;
        }

        /// <summary>
        /// Initializes a new instance of the structure.
        /// </summary>
        /// <param name="mode">Specifies the general indication mode.</param>
        /// <param name="mt">Specifies how new SMS-DELIVER messages should be indicated.</param>
        /// <param name="bm">Specifies how new Cell Broadcast messages should be indicated.</param>
        /// <param name="ds">Specifies how new SMS-STATUS-REPORT messages should be indicated.</param>
        /// <param name="bfr">Specifies how the indication buffer should be handled when indications are activated, i.e.
        /// when MessageIndicationSettings.Mode is set to any value except MessageIndicationMode.DoNotForward.</param>
        public MessageIndicationSettings(MessageIndicationMode mode, SmsDeliverIndicationStyle mt, CbmIndicationStyle bm, SmsStatusReportIndicationStyle ds, IndicationBufferSetting bfr) : this((int) mode, (int) mt, (int) bm, (int) ds, (int) bfr)
        {
        }

        /// <summary>
        /// Specifies the general indication mode.
        /// </summary>
        /// <remarks>
        /// You can use one of the MessageIndicationMode values to set this property.
        /// </remarks>
        public int Mode
        {
            get { return _mode; }
            set { _mode = value; }
        }

        /// <summary>
        /// Specifies how new SMS-DELIVER messages should be indicated.
        /// </summary>
        /// <remarks>
        /// You can use one of the SmsDeliverIndicationStyle values to set this property.
        /// </remarks>
        public int DeliverStyle
        {
            get { return _mt; }
            set { _mt = value; }
        }

        /// <summary>
        /// Specifies how new Cell Broadcast messages should be indicated.
        /// </summary>
        /// <remarks>
        /// You can use one of the CbmIndicationStyle values to set this property.
        /// </remarks>
        public int CellBroadcastStyle
        {
            get { return _bm; }
            set { _bm = value; }
        }

        /// <summary>
        /// Specifies how new SMS-STATUS-REPORT messages should be indicated.
        /// </summary>
        /// <remarks>
        /// You can use one of the SmsStatusReportIndicationStyle values to set this property.
        /// </remarks>
        public int StatusReportStyle
        {
            get { return _ds; }
            set { _ds = value; }
        }

        /// <summary>
        /// Specifies how the indication buffer should be handled when indications are activated, i.e.
        /// when MessageIndicationSettings.Mode is set to any value except MessageIndicationMode.DoNotForward.
        /// </summary>
        /// <remarks>
        /// You can use one of the IndicationBufferSetting values to set this property.
        /// </remarks>
        public int BufferSetting
        {
            get { return _bfr; }
            set { _bfr = value; }
        }
    }
}